// $Id: to_str.cpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#include <boost/test/unit_test.hpp>
#include <xpcom/result.hpp>
#include <xpcom/string.hpp>
#include <xpcom/result_code.hpp>

BOOST_AUTO_TEST_CASE(test_to_str)
{
    using namespace xpcom;

    result r1 = NS_ERROR_OUT_OF_MEMORY;
    const string s1 = "0x8007000E";
    string r_str;

    r1.to_str(r_str);
    BOOST_CHECK(r_str == s1);

    r_str.resize(1000, 'w');
    r1.to_str(r_str);
    BOOST_CHECK(r_str == s1);
}
